<?php
namespace Api\Controller;

use Think\Controller;

class IndexController extends CommonController
{
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * 首页
     * @return [type] [description]
     */
    public function index()
    {
        $data['banner']   = D('Api/Ad', 'Service')->user();
        $data['category'] = D('Api/Category', 'Service')->face();
        $data['tv']       = [];
        $data['article']  = D('Api/Article', 'Service')->top();
        $data['shop']     = D('Api/Shop', 'Service')->top();
        $data['theme']    = D('Api/Theme', 'Service')->lists();

        success($data);
    }

    /**
     * 测试
     * @return [type] [description]
     */
    public function test()
    {
        setting('appstart_android', 'https://mmshop.gzmao8.com/Uploads/appstart.png');
        setting('appstart_ios_480x1920', 'https://mmshop.gzmao8.com/Uploads/appstart.png');
        setting('appstart_ios_640x1136', 'https://mmshop.gzmao8.com/Uploads/appstart.png');
        setting('appstart_ios_750x1334', 'https://mmshop.gzmao8.com/Uploads/appstart.png');
        setting('appstart_ios_1242x2208', 'https://mmshop.gzmao8.com/Uploads/appstart.png');
    }

    /**
     * [im description]
     * @return [type] [description]
     */
    public function im()
    {
        $res = D('Api/User', 'Service')->im(402, '13430063211');
        success($res);
    }
}
